public class ReversePolishNotationEvaluatorTest {

    public static void main(String[] args) {
        ReversePolishNotationEvaluator evaluator = new ReversePolishNotationEvaluator();

        // 测试混合运算 1 2 3 * + 4 5 * 6 + 7 * +
        String[] expression1 = {"1", "2", "3", "*", "+", "4", "5", "*", "6","+","7","*", "+"};
        System.out.println(evaluator.evaluateRPN(expression1));// 189

        // 测试混合运算 "4 13 5 / +" 相当于 "4 + (13 / 5)" 应该等于 6
        String[] expression2 = {"4", "13", "5", "/", "+"};
        System.out.println(evaluator.evaluateRPN(expression2));// 6

        // 测试单个数字 "42" 应该等于 42
        String[] expression3 = {"42"};
        System.out.println(evaluator.evaluateRPN(expression3));// 42

        // 测试连续乘法 "2 3 4 * *" 相当于 "2 * 3 * 4" 应该等于 24
        String[] expression4 = {"2", "3", "4", "*", "*"};
        System.out.println(evaluator.evaluateRPN(expression4));// 24
    }
}